package com.itheima.jobs;

import com.itheima.dao.ClearOrderDao;
import com.itheima.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;

public class ClearOrderJob {

    @Autowired
    private ClearOrderDao clearOrderDao;

    public void clearOrder(){
        System.out.println("开始清除");
        try {
            String endString = DateUtils.parseDate2String(DateUtils.getToday(), "yyyy-MM-dd");
           /* String staString = endString + "-01";*/
            clearOrderDao.ClearOrder(endString);
            System.out.println("清除成功");
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
